<!doctype html>
<html lang="en-US">
<head>
	<meta charset="UTF-8" />
	<title>Congo Documentation</title>
	<link rel="stylesheet" type="text/css" href="pagestyle.css" />
</head>
<body>
	<div class="sheet container">
		<header class="main">

			<div class="title">
				<a href="Modules_congo.html"><img src="data/congo.png"/></a>Congo Documentation
			</div>

		</header>

		<div class="row content">
			<div class="span12">
			
				
<h1>Class <span class="name">GameData</span></h1>


	<p>Singleton class to store game data and settings, with functions to save/load state.
	<a href="#description"> More...</a></p>


<hr>

<table class="table scope-contents">
	
	
	
	
	

	

	
	
	
	
	

	

	
	
								
		<tr>
			<td class="span1 name">Constructors:</td>
			<td>
				<ul class="unstyled">
					
						<li><a href='#New'>New</a> ()</li>
					
				</ul>
			</td>
		</tr>
	
	
	
	
								
		<tr>
			<td class="span1 name">Methods:</td>
			<td>
				<ul class="unstyled">
					
						<li><a href='Modules_congo.gamedata_GameData.html#Exists'>Exists</a> : Bool ( keyword:String )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#LoadAll'>LoadAll</a> : Int ( overwrite:Bool=true )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#RetrieveBool'>RetrieveBool</a> : Bool ( keyword:String )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#RetrieveFloat'>RetrieveFloat</a> : Float ( keyword:String )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#RetrieveInt'>RetrieveInt</a> : Int ( keyword:String )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#RetrieveString'>RetrieveString</a> : String ( keyword:String )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#SaveAll'>SaveAll</a> : Void ()</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#StoreBool'>StoreBool</a> : Void ( keyword:String, value:Bool )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#StoreFloat'>StoreFloat</a> : Void ( keyword:String, value:Float )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#StoreInt'>StoreInt</a> : Void ( keyword:String, value:Int )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#StoreString'>StoreString</a> : Void ( keyword:String, value:String )</li>
					
						<li><a href='Modules_congo.gamedata_GameData.html#init'>init</a> : Void ()</li>
					
				</ul>
			</td>
		</tr>
	

									
		<tr>
			<td class="span1 name">Functions:</td>
			<td>
				<ul class="unstyled">
					
						<li><a href='#getInstance'>getInstance</a> : GameData ()</li>
					
				</ul>
			</td>
		</tr>
	
	
	
	
	
	
	
	
</table>


	<a name="description"></a>
	<h2>Detailed Discussion</h2>
	Singleton class to store game data and settings, with functions to save/load state. Internally,
uses Monkey's SaveState feature.
<p>
Currently, the data is stored as a simple string of key/value data pairs, with a pre-defined separator character. 
<p>
Note - Monkey SaveState can store about 1MB of data, but the precise details depend on platform.
<p>
Note - on mobile, the state data will likely persist unless the user does a full delete of the application.
<p>
Dev note - Todo: array/lists of each type. e.g. for highscores etc.
	
	
	<hr>






						
	<h2>Constructor Documentation</h2>
	<div class="scope-members-list">
		
			<div class="item">
				<a name='New'></a>
				<div class="well well-small name"><b>Method New ()</b></div>
				<div class="description">
					<p>	Private Constr. Creates instance of singleton as required.</p>
					
					
				</div>
			</div>
		
	</div>
	<hr>




						
	<h2>Method Documentation</h2>
	<div class="scope-members-list">
		
			<div class="item">
				<a name='Exists'></a>
				<div class="well well-small name"><b>Method Exists : Bool ( keyword:String )</b></div>
				<div class="description">
					<p>	Use this to check whether an entry exists.</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='LoadAll'></a>
				<div class="well well-small name"><b>Method LoadAll : Int ( overwrite:Bool=true )</b></div>
				<div class="description">
					<p>	Load all data from disk, overwriting local data unless specified by 'overwrite' flag.
	Returns the number of data values that were loaded.</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='RetrieveBool'></a>
				<div class="well well-small name"><b>Method RetrieveBool : Bool ( keyword:String )</b></div>
				<div class="description">
					<p>	Returns the requested boolean entry (if no key exists, will retrun a default value. See Exists() ).</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='RetrieveFloat'></a>
				<div class="well well-small name"><b>Method RetrieveFloat : Float ( keyword:String )</b></div>
				<div class="description">
					<p>	Returns the requested float entry (if no key exists, will retrun a default value. See Exists() ).</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='RetrieveInt'></a>
				<div class="well well-small name"><b>Method RetrieveInt : Int ( keyword:String )</b></div>
				<div class="description">
					<p>	Returns the requested integer entry (if no key exists, will retrun a default value. See Exists() ).</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='RetrieveString'></a>
				<div class="well well-small name"><b>Method RetrieveString : String ( keyword:String )</b></div>
				<div class="description">
					<p>	Returns the requested string entry (if no key exists, will retrun a default value. See Exists() ).</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='SaveAll'></a>
				<div class="well well-small name"><b>Method SaveAll : Void ()</b></div>
				<div class="description">
					<p>	Persists all current data to disk (via Monkey's SaveState). Will overwrite all previous data.
<p>
	You should call this at reasonable times, e.g. when settings are changed, or at the end of a level.</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='StoreBool'></a>
				<div class="well well-small name"><b>Method StoreBool : Void ( keyword:String, value:Bool )</b></div>
				<div class="description">
					<p>	Stores a boolean entry (will replace previous value if key already exists).</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='StoreFloat'></a>
				<div class="well well-small name"><b>Method StoreFloat : Void ( keyword:String, value:Float )</b></div>
				<div class="description">
					<p>	Stores a float entry (will replace previous value if key already exists).</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='StoreInt'></a>
				<div class="well well-small name"><b>Method StoreInt : Void ( keyword:String, value:Int )</b></div>
				<div class="description">
					<p>	Stores an integer entry (will replace previous value if key already exists).</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='StoreString'></a>
				<div class="well well-small name"><b>Method StoreString : Void ( keyword:String, value:String )</b></div>
				<div class="description">
					<p>	Stores a string entry (will replace previous value if key already exists).</p>
					
					
				</div>
			</div>
		
			<div class="item">
				<a name='init'></a>
				<div class="well well-small name"><b>Method init : Void ()</b></div>
				<div class="description">
					<p>	Internal. Called from constr.</p>
					
					
				</div>
			</div>
		
	</div>
	<hr>


						
	<h2>Function Documentation</h2>
	<div class="scope-members-list">
		
			<div class="item">
				<a name='getInstance'></a>
				<div class="well well-small name"><b>Function getInstance : <a href="Modules_congo.gamedata_GameData.html">GameData</a> ()</b></div>
				<div class="description">
					<p>	Use this to access the shared instance.</p>
					
					
				</div>
			</div>
		
	</div>
	<hr>


				
			</div>
		</div>
	</div>
</body>
</html>